<?php 
include "connect.php";
$ssa_id=$_POST['ssa_id'];
$subject_id=$_POST['subject_id'];
$teacher_id=$_POST['teacher_id'];
$class_id=$_POST['class_id'];
$date=$_POST['date'];
$session_id=$_POST['session_id'];
$roll_no=$_POST['roll_no'];
$present=$_POST['present'];

$sq=mysql_query("select * From student_subject_attendance where ssa_id = '$ssa_id'");
while($row=mysql_fetch_array($sq)){
	$sq2=mysql_query("select * From student_subject_attendance_detail where ssa_id='$ssa_id' AND roll_no='$roll_no'");
while ($row2 = mysql_fetch_array($sq2)) {
	
$sql=mysql_query("UPDATE student_subject_attendance SET ssa_id='$ssa_id',subject_id='$subject_id',teacher_id='$teacher_id',class_id='$class_id',date='$date',session_id='$session_id'
  where ssa_id='$ssa_id'") or die (mysql_error());


mysql_query("UPDATE student_subject_attendance_detail SET roll_no='$roll_no',present='$present'
  where ssa_id='$ssa_id' AND roll_no='$roll_no'") or die (mysql_error());

header("location:update student attendance.php");
}}




?>